package singleton;

public class SingletonTest04 {


    private SingletonTest04(){

    }

    //类加载的时候不会加载静态内部类，只有引用到该内部类才会加载，达到懒加载效果
    private static class SingletonInstance{
        private static final SingletonTest04 instance = new SingletonTest04();
    }

    public static SingletonTest04 getInstance(){
        return SingletonInstance.instance;
    }

}
